<template>
  <div>
    <NavType/>
    <List/>
    <Recommend/>
    <Rank/>
    <Like/>
    <!-- 根据请求回来的数据遍历生成Floor组件并传递数据 -->
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"/>
    <Brand/>
  </div>
</template>

<script>
import List from "./List"
import Recommend from "./Recommend"
import Rank from "./Rank"
import Like from "./Like"
import Floor from "./Floor"
import Brand from "./Brand"

import {requestFloorList} from "@/api"
export default {
    name: "Home",
    components:{
      List ,
      Recommend,
      Rank,
      Like,
      Floor,
      Brand,
    },
    data() {
      return {
        floorList: []
      }
    },

    mounted() {
      //1.请求floor数据
      this.getFloorList()
    },

    methods: {
      //1.请求floor数据的函数
      async getFloorList(){
        const result = await requestFloorList()
        this.floorList = result
      }
    },
    
}
</script>

<style>
</style>